function Model(viewer, option) {
  this.viewer = viewer;
  this.option = option;
  this.model;
  this.init();
}

Model.prototype.init = function() {
  let _this = this;
  this.model = _this.viewer.scene.primitives.add(Cesium.Model.fromGltf({
    id: _this.option.id,
    name: _this.option.name || '未命名',
    url: _this.option.url,
    type: _this.option.type,
    code: _this.option.code || '',
    show: _this.option.true,
    modelMatrix: _this.getMatrix(_this.option),
    scale: _this.option.scale * 1 || 1,
    minimumPixelSize: 50,
    maximumScale: 2000,
    allowPicking: true,
    debugShowBoundingVolume: false,
    debugWireframe: false,
    backFaceCulling: false,
  }));
}
Model.prototype.getMatrix = function(option) {
  var heading = Cesium.defaultValue(option.rotation.y, 0.0);
  var pitch = Cesium.defaultValue(option.rotation.x, 0.0);
  var roll = Cesium.defaultValue(option.rotation.z, 0.0);
  var headingPitchRoll = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(heading), Cesium.Math.toRadians(pitch),
    Cesium.Math.toRadians(roll));
  var origin = Cesium.Cartesian3.fromDegrees(option.position.x * 1, option.position.y * 1, option.position.z * 1);
  return Cesium.Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, Cesium.Ellipsoid.WGS84, Cesium.Transforms
    .eastNorthUpToFixedFrame, new Cesium.Matrix4());
}

Model.prototype.start = function(option) {
  let _this = this;
  setInterval(function() {
     option.position.x+=0.00001;
    _this.update(option);
    if(_this.option.callback){
      _this.option.callback(option.position);
    }
  }, 20); //millisec
}

Model.prototype.update = function(option) {
  this.model.modelMatrix = this.getMatrix(option);
}
Model.prototype.destroy = function() {

}
